package com.tx.studentManager.model;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import org.hibernate.annotations.GenericGenerator;

/**
 * 
 * @描述 专业实体表
 * @since studentManager-admin 1.0
 * @version 1.0 2015-9-14 上午11:26:01
 * @author 此生唯晴
 */
@Entity
@Table(name = "major", catalog = "studentManager")
@DynamicInsert(true)
@DynamicUpdate(true)
public class Major extends BaseModel {

	private static final long serialVersionUID = 6136697626141095621L;

	@Id
	@GenericGenerator(name = "idGenerator", strategy = "uuid")
	@GeneratedValue(generator = "idGenerator")
	@Column(name = "majorId", nullable = false, length = 32)
	private String majorId;

	@Column(name = "majorName", nullable = false)
	private String majorName;

	@ManyToOne
	@JoinColumn(name = "depId", insertable = true, nullable = true)
	private Department department;

	@Column(name="createDate",nullable=false)
	private Date createDate;
	
	public Date getCreateDate() {
		return createDate;
	}

	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	public String getMajorId() {
		return majorId;
	}

	public void setMajorId(String majorId) {
		this.majorId = majorId;
	}

	public String getMajorName() {
		return majorName;
	}

	public void setMajorName(String majorName) {
		this.majorName = majorName;
	}

	public Department getDepartment() {
		return department;
	}

	public void setDepartment(Department department) {
		this.department = department;
	}

}
